import  dayjs  from "dayjs";

export default (qty) => {
  let taskCount = 23000;
let count = 0;
  return {
    list: Array.from({ length: qty }, (_, index) => {
      count += 3;

      return {
        pkid: index.toString(), // pkid ->当前行父任务主键
        project:
          "ROCKET" +
          dayjs()
            .add(count, "day")
            .format("MMDD"),
        prodLine: "生产线-" + index,
        zone: "月球",
        /* tasks -> 子任务对象属性  */
        tasks: [
          {
            pkid: (taskCount++).toString(), // 子任务主键
            startTime:
              dayjs()
                .subtract(1, "day")
                .format("YYYY-MM-DD") + " 00:00:00", // startTime -> 任务开始日期
            endTime:
              dayjs()
                .add(1, "day")
                .format("YYYY-MM-DD") + " 00:00:00", // endTime ->任务结束日期
            content: "Daily check", // 任务内容
            background: "rgb(182,220,22)", // background ->任务条背景色
            color: "black", // color ->任务条字体颜色
            disabled: false, // disabled ->当前任务是否无法被拖动或编辑
          },
          {
            pkid: (taskCount++).toString(),
            startTime: dayjs()
              .add(2, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            endTime: dayjs()
              .add(4, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            content: "Fuel System force check",
            background: "rgb(195,235,203)",
          },
          {
            pkid: (taskCount++).toString(),
            startTime: dayjs()
              .add(5, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            endTime: dayjs()
              .add(6, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            content: "Task 31. Replace panel.",
            background: "rgb(223,212,122)",
          },
          {
            pkid: (taskCount++).toString(),
            startTime: dayjs()
              .add(7, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            endTime: dayjs()
              .add(11, "day")
              .format("YYYY-MM-DD HH:mm:ss"),
            content: "加注固态燃料",
            background: "rgb(119,177,232)",
          },
          {
            pkid: (taskCount++).toString(),
            startTime: "2023-07-01 00:00:00",
            // startTime: dayjs()
            //   .add(26, "day")
            //   .format("YYYY-MM-DD HH:mm:ss"),
            endTime: "2023-07-03 00:00:00",
            content: "发射日期时间段",
            background: "rgb(229,150,134)",
          },
          {
            pkid: (taskCount++).toString(),
            startTime: "2023-08-01 00:15:00",
            // startTime: dayjs()
            //   .add(26, "day")
            //   .format("YYYY-MM-DD HH:mm:ss"),
            endTime: "2023-08-29 00:00:00",
            content: "发射日期时间段",
            background: "rgb(229,150,134)",
          },
          {
            pkid: (taskCount++).toString(),
            startTime: "2024-01-15 00:00:00",
            // startTime: dayjs()
            //   .add(26, "day")
            //   .format("YYYY-MM-DD HH:mm:ss"),
            endTime: "2024-01-17 00:00:00",
            content: "发射日期时间段",
            background: "rgb(229,150,134)",
          },
        ],
      };
    }),
  };
};
